//
//  MainViewController.m
//  ZSHUDSet-master
//
//  Created by safiri on 2018/7/2.
//  Copyright © 2018年 safiri. All rights reserved.
//

#import "MainViewController.h"
#import "ViewController.h"
#import "XNProgressHUDVC.h"
#import "ExampleVC.h"

@interface MainViewController ()<UITableViewDelegate, UITableViewDataSource>

@property (nonatomic ,strong) NSArray *HUDTitles;

@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.HUDTitles = @[@"ZSTopDownHUD", @"XNProgressHUD",@"ExampleVC"];
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.HUDTitles.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    cell.textLabel.text = self.HUDTitles[indexPath.row];
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
    
    if (indexPath.row == 0) {
        ViewController *topDownHUDVC = [storyboard instantiateViewControllerWithIdentifier:@"ViewController"];
        [self.navigationController pushViewController:topDownHUDVC animated:YES];
    }
    else if (indexPath.row == 1) {
        XNProgressHUDVC *xnHUDVC = [storyboard instantiateViewControllerWithIdentifier:@"XNProgressHUDVC"];
        [self.navigationController pushViewController:xnHUDVC animated:YES];
    }
    else if (indexPath.row == 2) {
        ExampleVC *xnHUDVC = [[ExampleVC alloc] init];
        [self.navigationController pushViewController:xnHUDVC animated:YES];
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
